<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>指令缩写</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app">
        <h3>v-bind 缩写</h3>
        <!-- 完整语法 -->
        <a v-bind:href="url">百度</a>

        <!-- 缩写 -->
        <a :href="url">百度</a>

        <h3>v-on 缩写</h3>
        <!-- 完整语法 -->
        <button v-on:click="doSomething">点击</button>
        <!-- 缩写 -->
        <button @click="doSomething">点击</button>


    </div>
</body>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            url: 'https://www.baidu.com'
        },
        methods: {
            doSomething: function() {
                console.log('do something...')
            }
        }
    })
</script>
</html>